<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    间歇函数  setInterval(函数，间隔时间)
    <script>
        let one=setInterval(function() {
            console.log('每一秒执行一次')
            
        },1000)     //1秒钟是1000毫秒
        function fn(){
            console.log('再次一秒钟执行一次')
            
        }
        fn()
        let n =setInterval(fn,1000)
        // clearInterval(n)
        clearInterval(one)

    </script>
</body>
</html>